#ifndef READONLYDELEGATE_H
#define READONLYDELEGATE_H

#include <QObject>
#include <QStyledItemDelegate>

class ReadOnlyDelegate : public QStyledItemDelegate
{
    Q_OBJECT
public:
    explicit ReadOnlyDelegate(QObject *parent = nullptr);

    // 重写 editorEvent 来控制是否允许编辑
    bool editorEvent(QEvent *event, QAbstractItemModel *model, const QStyleOptionViewItem &option,
                     const QModelIndex &index) override;

signals:

};

#endif // READONLYDELEGATE_H
